package app.project.streetlensproject.model;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import app.project.streetlensproject.util.Base64;

public class Category {
	public int categoryId;
	public String name;
	public int imageId;
	public String image;

	public Category(int id, String name, int imageId) {
		this.categoryId = id;
		this.name = name;
		this.imageId = imageId;
	}

	public Category() {
	}

	public Bitmap getBitmap() {
		try {
			byte[] imageAsBytes = Base64.decode(image.getBytes());
			return BitmapFactory.decodeByteArray(imageAsBytes, 0, imageAsBytes.length);
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	}
}
